Field of the Invention:
The invention lies in the field of electronics and relates, in particular, to a program-controlled unit which is enabled to select individual segments for use from an available memory by using a segment pointer.
Program-controlled units of this type are, for example, microprocessors, microcontrollers, or signal processors. As a rule, they are designed to execute programs straight away from the beginning (from the time when they are switched on or reset). The programs to be executed, more precisely the program codes representing the programs, may thereby be stored in program memories provided in the program-controlled unit or be read into the program-controlled unit externally via an interface to an external memory or a serial interface.
The fundamental structure of a program-controlled unit in which all of the above-mentioned possibilities are optionally available is illustrated in FIG. 3. A program-controlled unit 1 shown there comprises a central processing unit (CPU) 11, a first read-only memory in the form of a first ROM 12, a second read-only memory in the form of a second ROM 13, an internal random-access memory in the form of an internal RAM 14, a (memory) interface 15 for connecting the program-controlled unit 1 to a non-illustrated external memory and a serial interface 16.
The program which is intended to be executed when the program-controlled unit 1 is started up or is reset may be stored in the first ROM 12, in the second ROM 13, or in the external memory.
Whether the startup program that is executed when the program-controlled unit is started up or on reset is a program stored in the first ROM 12, a program stored in the second ROM 13 or a program stored in the external memory, depends on the addresses under which the respective memories can be addressed at the relevant point in time. The program to be executed after the program-controlled unit has been started up or reset is read out by the program-controlled unit in standard fashion, starting from a quite specific address. In the exemplary embodiment, the address is equal to zero. If it is the first ROM 12 which can be addressed via the address 0, then the program which is stored in the first ROM 12 starting from the location which can be addressed by the address 0 is executed. If it is the second ROM 13 which can be addressed via the address 0, then the program stored in the second ROM 13 starting from the location which can be addressed by the address 0 is executed. If it is the external memory that can be addressed via the address 0, then the program stored in the external memory starting from the location that can be addressed by the address 0 is executed.
Programs stored within the program-controlled unit are, for example, the so-called bootstrap loaders. A bootstrap loader is a program which enables the following to be instigated: data representing programs are read in via the serial interface 16 of the program-controlled unit 1, are stored in the internal RAM 14 and, finally, are read from the latter and executed.
The bootstrap loader is stored in the second ROM 13 in the exemplary embodiment. In order that the bootstrap loader is executed after the program-controlled unit has been started up or reset, it is necessary to ensure that the second ROM 13, more precisely the location starting from which the bootstrap loader is stored therein, can be addressed via the address 0. This is done by mapping the second ROM 13, at least during the execution of the bootstrap loader, onto that location of the memory area (which can be addressed by the program-controlled unit) at which the read-out of the program code is begun after the program-controlled unit has been switched on or reset.
As a result of the mapping, the relevant memory is temporarily allocated specific addresses; consequently, specific memory regions can selectively be inserted into the memory space (which is addressable by the program-controlled unit) or be blanked out therefrom.
If a program stored in the first ROM 12 or in the external memory is intended to be executed, rather than the bootstrap loader, after the program-controlled unit has been started up or reset, then the first ROM 12 or the external memory must be made addressable via the address 0 by means of mapping.
Mapping is associated with a quite considerable outlay in terms of management and organizational resources.